package com.work.cos.service.impl.msg;

import java.util.List;

import javax.annotation.Resource;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import com.work.cos.domain.entity.msg.MsgMessageEntity;
import com.work.cos.mapper.msg.IMsgMessageMapper;
import com.work.cos.service.interfc.msg.IMsgMessageService;

/**
 * Created by intel on 2018/3/30.
 */

@Service
public class MsgMessageServiceImpl implements IMsgMessageService{

    /**
     * Logger
     */
    private static final Logger logger = LoggerFactory.getLogger(MsgMessageServiceImpl.class);

    @Resource
    private IMsgMessageMapper messageMapper;

	@Override
	public List<MsgMessageEntity> getAll() {
		logger.debug("getAll");
		return this.messageMapper.getAll();
	}

	@Override
	public List<MsgMessageEntity> getAllByIsDel(int isDel) {
		 logger.debug("get all by isDel ...");
		 return this.messageMapper.getAllByIsDel(isDel);
	}

	@Override
	public List<MsgMessageEntity> getMessagesByTypeId(Long typeId) {
		return this.messageMapper.getMessagesByTypeId(typeId);
	}

	@Override
	public List<MsgMessageEntity> getMessagesByTypeIdAndIsDel(Long typeId, int isDel) {
		return this.messageMapper.getMessagesByTypeIdAndIsDel(typeId, isDel);
	}

	@Override
	public MsgMessageEntity getOne(Long id) {
		return this.messageMapper.getOne(id);
	}

	@Override
	public MsgMessageEntity getOneByIdAndIsDel(Long id, int isDel) {
		return this.messageMapper.getOneByIdAndIsDel(id, isDel);
	}

	@Override
	public void insert(MsgMessageEntity entity) {
		this.messageMapper.insert(entity);
	}

	@Override
	public void update(MsgMessageEntity entity) {
		this.messageMapper.update(entity);
	}

	@Override
	public void delete(Long id) {
		this.messageMapper.delete(id);
	}
}
